package com.ohos.liveeventbus.ipc.core;

import com.ohos.liveeventbus.ipc.consts.IpcConst;
import ohos.aafwk.content.IntentParams;

/**
 * Created by liaohailiang on 2019/5/30.
 */
public class StringProcessor implements Processor {

    @Override
    public boolean writeToBundle(IntentParams bundle, Object value) {
        if (!(value instanceof String)) {
            return false;
        }
        bundle.setParam(IpcConst.KEY_VALUE, (String) value);
        return true;
    }

    @Override
    public Object createFromBundle(IntentParams bundle) {
        return bundle.getParam(IpcConst.KEY_VALUE);
    }
}
